module.exports = (sequelize, Sequelize) => {
	const rxreq = sequelize.define(
		'rxreq_info',
		{
			rxreqId: { type: Sequelize.STRING(10), primaryKey: true },
            userId: { type: Sequelize.STRING(15), allowNull: false, references: {
				model: 'accounts',
				key: 'userId'
			}, },
            userName: { type: Sequelize.STRING(10), allowNull: false },
			userRealname: { type: Sequelize.STRING(15), allowNull: false },
            rxreqUsersituation: { type: Sequelize.STRING(200), allowNull: false },
            rxreqName: { type: Sequelize.STRING(100), allowNull: false },
            rxreqDate: { type:Sequelize.DATE(6), allowNull: false },
            rxreqDocrxpic: { type: Sequelize.TINYINT(1), allowNull: false },
            rxreqIdenpic: { type: Sequelize.TINYINT(1), allowNull: false },
            userSex: { type: Sequelize.CHAR(1), allowNull: false },
            userAge: { type: Sequelize.STRING(3), allowNull: false },
            rxreqSituation: { type: Sequelize.TINYINT(1), allowNull: false },
            rxreExamresult: { type: Sequelize.TINYINT(1)  },
            rxreqExamid: { type: Sequelize.STRING(15) }
		},
		{
			// 禁止 updatedAt, createdAt 自增
			timestamps: false,
			// 自定义表名
			freezeTableName: true,
		}
	)

	return rxreq
}
